﻿using System;
using UnityEngine;

// Token: 0x020001E3 RID: 483
public class WanderAction : AgentAction
{
	// Token: 0x06000A4B RID: 2635 RVA: 0x0005A5B4 File Offset: 0x000587B4
	public WanderAction(float timeLimit = 0f)
	{
		this.name = "Wander";
		if (timeLimit > 0f)
		{
			this.endTime = Time.time + timeLimit;
		}
	}

	// Token: 0x06000A4C RID: 2636 RVA: 0x0005A5DF File Offset: 0x000587DF
	public override void StartAction()
	{
		this.agent.movement.StartWanderBehavior();
	}

	// Token: 0x06000A4D RID: 2637 RVA: 0x0005A5F4 File Offset: 0x000587F4
	public override bool IsCompleted()
	{
		if (this.endTime > 0f && Time.time > this.endTime)
		{
			this.Interrupt();
			return this.hasStarted;
		}
		return this.hasStarted && !this.agent.movement.move;
	}

	// Token: 0x06000A4E RID: 2638 RVA: 0x00059F3D File Offset: 0x0005813D
	public override void Interrupt()
	{
		this.agent.movement.Stop();
	}

	// Token: 0x04000FA1 RID: 4001
	private float endTime;
}
